
<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        <div class="layui-form-item">
            <label class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input type="text" name="title" class="layui-input" placeholder="请输入分类名称" value="">
            </div>
        </div>
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-filter="demo1" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>
    </form>
</div>
<script type="text/javascript">
    layui.use(['form','upload'], function(){
        var form = layui.form;
        var upload = layui.upload;
        $ = layui.$;
        //各种基于事件的操作。
//监听提交
        form.on('submit(demo1)', function(data){
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });

        // $('#zzList').append(`
        //     <div class="layui-form-item" >
        //         <label class="layui-form-label required">作者2</label>
        //         <div style="display: flex;">
        //             <div>
        //                 <input type="text" name="name2" class="layui-input" placeholder="请输入作者名称" value="">
        //             </div>
        //             <div style="display: flex;">
        //                 <input name="image2" class="layui-input layui-col-xs6" readonly  placeholder="请上传图片" value="">
        //                 <div class="layuimini-upload-btn">
        //                 <span>
        //                     <a class="layui-btn" data-upload="image2" data-upload-number="one" data-upload-exts="png|jpg|ico|jpeg" data-upload-icon="image">
        //                         <i class="fa fa-upload"></i>上传</a>
        //                 </span>
        //                 </div>
        //             </div>
        //         </div>
        //     </div>
        // `)
        // $('#zzList input').change(function () {
        // })

    });
</script>